package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class Promotion implements Serializable {

	private static final long serialVersionUID = -2585820485193489943L;

	private int numPromotion;
	private Formation formation;
	private Collection<Periode> listePeriodes;
	private Collection<Etudiant> listeEtudiants;

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Promotion() {}
	
	public Promotion(int numPromotion, Formation formation) {
		super();
		this.numPromotion = numPromotion;
		this.formation = formation;
		this.listeEtudiants = null;
		this.listePeriodes = null;
	}

	public Collection<Etudiant> getListeEtudiants() {
		return listeEtudiants;
	}

	public void setListeEtudiants(Collection<Etudiant> listeEtudiants) {
		this.listeEtudiants = listeEtudiants;
	}

	public int getNumPromotion() {
		return numPromotion;
	}
	
	public Collection<Periode> getPeriodes() {
		return listePeriodes;
	}

	public void setPeriodes(Collection<Periode> periodes) {
		this.listePeriodes = periodes;
	}
	
	public void setNumPromotion(int numPromotion) {
		this.numPromotion = numPromotion;
	}
	
	public Formation getFormation() {
		return formation;
	}
	
	public void setFormation(Formation formation) {
		this.formation = formation;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
